import myAxios from '../plugins/myAxios'

// 获取教师个人信息
export const getTeacherInfoAPI = () => {
  return myAxios.get('/teacher/self/info')
}

// 更新教师个人信息
export const updateTeacherInfoAPI = (teacherInfo) => {
  return myAxios.post('/teacher/self/update', teacherInfo)
}


//===========================管理员端===================================
/**
 * 获取教师列表
 * @param params 查询参数
 * @returns {Promise}
 */
export const getTeacherList = (params) =>{
  return myAxios.get('/admin/teacher/list', { params })
}

/**
 * 更新教师信息
 * @param data 教师信息
 * @returns {Promise}
 */
export const updateTeacher =(data) => {
  return myAxios.post('/admin/teacher/update', data)
}

/**
 * 删除教师
 * @param id 教师ID
 * @returns {Promise}
 */
export const deleteTeacher = (id) => {
  return myAxios.post(`/admin/teacher/delete/${id}`)
}

export const addTeacher = (data) => {
  return myAxios.post('/admin/teacher/add',data)
}
